﻿/**
 * ...
 * @author sminutoli
 */
import com.dmotiko.prune.*
import com.dmotiko.general.*
 
class CampaignBar extends SiteBar
{
	
	public static var FOTOS:String = "campaignbar_fotos";
	public static var GACETILLA:String = "campaignbar_gacetilla";
	
	private function initClip():Void {
		super.initClip();
		sLink = "MainSubBtn";
		setData( [ { label: "FOTOS", value: FOTOS }, { label: "GACETILLA", value: GACETILLA } ] );
	}
	
	private function section_changed(e):Void {
		if ( e.section == SiteSections.CAMPAIGN ) {
			btns[0].onRelease();
			this._x = 63;
			this._y = 325;
			show();
		} else {
			hide();
			if( Site.getApp().getClips().getGacetilla().isShowed() ) Site.getApp().getClips().getGacetilla().hide();
		}
	}
	
	private function btn_changed( e ):Void 
	{
		super.btn_changed(e);		
		if ( e.data.value == GACETILLA ) {
			Site.getApp().getClips().getShadow().show();
			Site.getApp().getClips().getGacetilla().show();
		} else {
			Site.getApp().getClips().getShadow().hide();
			Site.getApp().getClips().getGacetilla().hide();
		}
	}
	
}